﻿<Window x:Class="FrontEnd.Import"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:fe="clr-namespace:FrontEnd"   
        Title="Import" Height="720" Width="980">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Margin="5">
            <Label Content="Source File:" />
			<fe:SelectFileTextBox x:Name="fileSelector" Width="170" Filter="Comma Delimited (*.csv)|*.csv" FileValidating="FileValidating" FileValidated="FileValidated" />
            <Label Content="Destination Table:" Margin="5,0,0,0" />
			<ComboBox Name="cboTableNames" ItemsSource="{Binding}" Width="150" />
            <Label Content="Delimeter:" Margin="5,0,0,0" />
			<TextBox Text="," Width="20" FontWeight="Bold" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
			<Label Content="On Conflict Do:"  Margin="5,0,0,0" />
			<ComboBox Width="80" VerticalContentAlignment="Center" Padding="7,0,0,0">
				<ComboBoxItem Content="Insert" />
				<ComboBoxItem Content="Overwrite" />
				<ComboBoxItem Content="Update" />
				<ComboBoxItem Content="Ignore" IsSelected="True" />
			</ComboBox>
			<CheckBox Name="chkHasColumnNames" Content="Contains Column Names" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" />
		</StackPanel>

		<Grid Grid.Row="1" Margin="5">
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition Width="auto" />
				<ColumnDefinition Width="1.5*" />
			</Grid.ColumnDefinitions>

			<fe:VisualFieldMapper />
			<!--<Canvas>
	
					<StackPanel>
						<StackPanel Orientation="Horizontal">
							<Border BorderBrush="Black" BorderThickness="1" Width="100" Height="25" Background="LightBlue">
								<TextBlock TextWrapping="Wrap" Text="Some Text" VerticalAlignment="Center" HorizontalAlignment="Center"/>
							</Border>
							<Ellipse Width="7" Height="7" Fill="DarkGray" AllowDrop="True"></Ellipse>
						</StackPanel>
						<StackPanel Orientation="Horizontal">
							<Border BorderBrush="Black" BorderThickness="1" Width="100" Height="25" Background="LightBlue">
								<TextBlock TextWrapping="Wrap" Text="Some Text" VerticalAlignment="Center" HorizontalAlignment="Center"/>
							</Border>
							<Ellipse Width="7" Height="7" Fill="DarkGray" AllowDrop="True"></Ellipse>
						</StackPanel>
						<StackPanel Orientation="Horizontal">
							<Border BorderBrush="Black" BorderThickness="1" Width="100" Height="25" Background="LightBlue">
								<TextBlock TextWrapping="Wrap" Text="Some Text" VerticalAlignment="Center" HorizontalAlignment="Center"/>
							</Border>
							<Ellipse Width="7" Height="7" Fill="DarkGray" AllowDrop="True"></Ellipse>
						</StackPanel>
					</StackPanel>

				<StackPanel  Canvas.Left="150">
					<StackPanel Orientation="Horizontal">
						<Ellipse Width="7" Height="7" Fill="DarkGray" AllowDrop="True"></Ellipse>
						<Border BorderBrush="Black" BorderThickness="1" Width="100" Height="25" Background="LightBlue">
							<TextBlock TextWrapping="Wrap" Text="Some Text" VerticalAlignment="Center" HorizontalAlignment="Center"/>
						</Border>
					</StackPanel>
					<StackPanel Orientation="Horizontal">
						<Ellipse Width="7" Height="7" Fill="DarkGray" AllowDrop="True"></Ellipse>
						<Border BorderBrush="Black" BorderThickness="1" Width="100" Height="25" Background="LightBlue">
							<TextBlock TextWrapping="Wrap" Text="Some Text" VerticalAlignment="Center" HorizontalAlignment="Center"/>
						</Border>
					</StackPanel>
					<StackPanel Orientation="Horizontal">
						<Ellipse Width="7" Height="7" Fill="DarkGray" AllowDrop="True"></Ellipse>
						<Border BorderBrush="Black" BorderThickness="1" Width="100" Height="25" Background="LightBlue">
							<TextBlock TextWrapping="Wrap" Text="Some Text" VerticalAlignment="Center" HorizontalAlignment="Center"/>
						</Border>
					</StackPanel>
				</StackPanel>
			</Canvas>-->
			
			<GridSplitter Grid.Column="1" Width="4" HorizontalAlignment="Stretch"/>
			
			<DataGrid Name="grdImportData" ItemsSource="{Binding}" IsReadOnly="True" Grid.Column="2" />
		</Grid>

		<StackPanel Orientation="Horizontal" Grid.Row="2" Margin="5">
			<Button Content="Execute" Margin="5,0,0,0" Width="60" />
        </StackPanel>
    </Grid>
</Window>
